;a-r
(defun func-a-r (x)
	(if (null x)
		'done
		(if (not (< x 1))
			(progn 
				(format t ".")
			;	(format t "~A~%" (/ x 10))
				(func-a (/ x 10)))
			(format t "~%"))))

;a
(defun func-a (x)
	(if (null x)
		'done
		(do ((n x (/ n 10)))
			((< n 1) (format t "~%")) 
			(format t "."))))

(format t "递归方式输出数字长度:~%")
(func-a-r (read))
(format t "非递归输出数字长度:~%")
(func-a (read))

;b
(defun func-b (x l)
	(do ((n 0 n) (lst l (cdr lst)))
		((null lst) (format t "~A" n))
		(if (eq x (car lst))
			(setf n (+ n 1))
			'done)))

;b-r
(defun func-b-r (x l) 
  (if (null l)
    0
    (if (eq x (car l))
      (+ 1 (func-b-r x (cdr l)))
      (func-b-r x (cdr l)))))

(format t "递归求x的个数:~%")
(format t "~A~%" (func-b-r 'a '(b a b a a b)))
(format t "非递归求x的个数:~%")
(func-b  'a '(b a a a b a))
